package com.dongdongshop.service.impl;

import com.dongdongshop.dao.ItemRepository;
import com.dongdongshop.pojo.item.TbItem;
import com.dongdongshop.service.item.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @Author Eayon
 * @Date 2020/4/4 17:42
 */
@Service
public class ItemServiceImpl implements ItemService {

    @Autowired
    private ItemRepository itemRepository;

    @Override
    public TbItem findItemById(Long itemId) {
        Optional<TbItem> optional = itemRepository.findById(itemId);
        TbItem item = optional.get();
        return item;
    }
}
